package org.jground.rx.def.apps.accounting;
import org.jground.rx.*;
import org.jground.rx.gen.*;
import org.jground.util.*;
import java.util.List;
import org.jground.rx.def.apps.commons.*;
import org.jground.rx.def.apps.knowledge.*;
import org.jground.rx.def.*;
import org.jground.rx.def.apps.crm.*;
import org.jground.rx.def.apps.cip.*;
import org.jground.rx.def.apps.core.*;
import org.jground.rx.def.apps.legal.*;
import org.jground.rx.def.apps.ipm.*;
@SuppressWarnings("unused")
public class Workforce extends GenRoot {

    public static final String moid = "org.jground.rx.def.apps.accounting.Workforce";

    private static final String userName ="userName";
    private static final String rateType ="rateType";
    private static final String rate ="rate";
    private static final String $CREATOR ="$CREATOR";

    public static final class AttName {
        public static final String userName ="userName";
        public static final String rateType ="rateType";
        public static final String rate ="rate";
        public static final String $CREATOR ="$CREATOR";
    }

    public static Workforce createNew() { return new Workforce(RXObjectService.getInstance().create(moid)); }

    public static Workforce getById(String oid) { 
        IRXObject mod = RXObjectService.getInstance().getById(oid);
        if(mod == null) { return null; }
        return new Workforce(mod);
    }

    public static Workforce[] getByIds(String... oids) { 
        List<IRXObject> mods = RXObjectService.getInstance().getByIds(moid, oids);
        Workforce[] res = new Workforce[mods.size()];
        int i = 0;
        for(IRXObject mod : mods) {
            res[i] = new Workforce(mod);
            i++;
        }
        return res;
    }

    public static SearchCriteria newSearchCriteria() {
        return  SearchCriteria.create(moid);
    }

    public static Workforce[] search(SearchCriteria sc) {
        return  wrap(GenRoot._search(sc));
    }

    public static Workforce[] wrap(List<? extends IRXObjectSynopsis> mods) { 
        Workforce[] res = new Workforce[mods.size()];
        int i = 0;
        for(IRXObjectSynopsis mod : mods) {
            res[i] = new Workforce(mod);
            i++;
        }
        return res;
    }

    public static Workforce wrap(IRXObjectSynopsis mod) { 
        return new Workforce(mod);
    }

    private Workforce(IRXObjectSynopsis rxObject) {this.rxObject = (IRXObject) rxObject;}

    public static String getUserNameLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, userName).getLabel();
    }

    public static String getUserNameDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, userName).getDescription();
    }

    public void setUserName(String string) {
        rxObject.set(userName, _to_String(string));
    }

    public String getUserName() {
        return _to_String(rxObject.getCurrentValue(userName));
    }

    public static String getRateTypeLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, rateType).getLabel();
    }

    public static String getRateTypeDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, rateType).getDescription();
    }

    public void setRateType(String codeValue) {
        rxObject.set(rateType, _to_String(codeValue));
    }

    public String getRateType() {
        return _to_String(rxObject.getCurrentValue(rateType));
    }

    public static String getRateLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, rate).getLabel();
    }

    public static String getRateDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, rate).getDescription();
    }

    public void setRate(Currency currency) {
        rxObject.set(rate, _to_String(currency));
    }

    public Currency getRate() {
        return _to_Currency(rxObject.getValues(rate));
    }

    public static String get$CREATORLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getLabel();
    }

    public static String get$CREATORDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getDescription();
    }

    public void set$CREATOR(String string) {
        rxObject.set($CREATOR, _to_String(string));
    }

    public String get$CREATOR() {
        return _to_String(rxObject.getCurrentValue($CREATOR));
    }

}
